#ifndef BLEND_STATE_H
#define BLEND_STATE_H
#ifdef USE_OPENGL
#ifdef WIN32
#include "OpenGLExt.h"
#else
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#endif
#endif

struct BlendState
{
	enum BlendEquation
	{
#ifdef USE_OPENGL
		BLEND_EQUATION_ADD = GL_FUNC_ADD,
		BLEND_EQUATION_SUBTRACT = GL_FUNC_SUBTRACT,
		BLEND_EQUATION_REVERSE_SUBTRACT = GL_FUNC_REVERSE_SUBTRACT,
		BLEND_EQUATION_MIN = GL_MIN,
		BLEND_EQUATION_MAX = GL_MAX,
#else
		BLEND_EQUATION_ADD,
		BLEND_EQUATION_SUBTRACT,
		BLEND_EQUATION_REVERSE_SUBTRACT,
		BLEND_EQUATION_MIN,
		BLEND_EQUATION_MAX,
#endif
	};

	enum BlendFactor
	{
#ifdef USE_OPENGL
		BLEND_FACTOR_ZERO = GL_ZERO,
		BLEND_FACTOR_ONE = GL_ONE,
		BLEND_FACTOR_SRC_COLOR = GL_SRC_COLOR,
		BLEND_FACTOR_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
		BLEND_FACTOR_DST_COLOR = GL_DST_COLOR,
		BLEND_FACTOR_ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR,
		BLEND_FACTOR_SRC_ALPHA = GL_SRC_ALPHA,
		BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
		BLEND_FACTOR_DST_ALPHA = GL_DST_ALPHA,
#else
		BLEND_FACTOR_ZERO,
		BLEND_FACTOR_ONE,
		BLEND_FACTOR_SRC_COLOR,
		BLEND_FACTOR_ONE_MINUS_SRC_COLOR,
		BLEND_FACTOR_DST_COLOR,
		BLEND_FACTOR_ONE_MINUS_DST_COLOR,
		BLEND_FACTOR_SRC_ALPHA,
		BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
		BLEND_FACTOR_DST_ALPHA,
#endif
	};

	BlendEquation alphaBlendEquation;
	BlendEquation colorBlendEquation;
	BlendFactor alphaSrcBlendFactor;
	BlendFactor colorSrcBlendFactor;
	BlendFactor alphaDestBlendFactor;
	BlendFactor colorDestBlendFactor;
	BlendState()
	{
		alphaBlendEquation = BLEND_EQUATION_ADD;
		colorBlendEquation = BLEND_EQUATION_ADD;
		alphaSrcBlendFactor = BLEND_FACTOR_ZERO;
		colorSrcBlendFactor = BLEND_FACTOR_SRC_ALPHA;
		alphaDestBlendFactor = BLEND_FACTOR_ONE;
		colorDestBlendFactor = BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
	}
};
#endif